//
//  GRNoDohead.m
//  test
//
//  Created by 李彦宏 on 2018/3/10.
//  Copyright © 2018年 朱圳. All rights reserved.
//

#import "GRNoDohead.h"
#define  BGreen  [UIColor colorWithRed:72/225.0 green:211/255.0 blue:86/255.0 alpha:1.0]
#define  BRead  [UIColor colorWithRed:219/225.0 green:83/255.0 blue:80/255.0 alpha:1.0]
@implementation GRNoDohead
//自定义head初始化方法
- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        [self setUI];
    }
    return self;
}
//添加子控件
-(void)setUI{
    UILabel *lb1=[[UILabel alloc]initWithFrame:CGRectMake(5, 0, 90, 40)];
    lb1.text=@"2017/12/20";
    lb1.textAlignment=NSTextAlignmentCenter;
    lb1.font=[UIFont systemFontOfSize:14];
    lb1.numberOfLines=0;
    lb1.textColor=[UIColor blackColor];
    self.data=lb1;
    [self.contentView addSubview:lb1];
    
    UIButton *lb2=[[UIButton alloc]initWithFrame:CGRectMake(ScreenWidth/4+20, 8, 35, 25)];
    [lb2 setTitle:@"详情" forState:UIControlStateNormal];
    [lb2 setTitleColor:[UIColor greenColor] forState:UIControlStateNormal];
    lb2.titleLabel.font=[UIFont systemFontOfSize:14];
    
    self.cont=lb2;
    [self.contentView addSubview:lb2];
    
    UILabel *lb3=[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth/2+10, 8, 50, 25)];
    lb3.text=@"255";
    lb3.textAlignment=NSTextAlignmentCenter;
    lb3.font=[UIFont systemFontOfSize:14];
    lb3.textColor=[UIColor blackColor];
    self.sum=lb3;
    [self.contentView addSubview:lb3];
    
    _YesBtn=[[UIButton alloc]initWithFrame:CGRectMake(ScreenWidth-100, 6, 45, 30)];
    [_YesBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [_YesBtn setTitle:@"同意" forState:UIControlStateNormal];
    _YesBtn.titleLabel.font=[UIFont systemFontOfSize:15];
    [_YesBtn setBackgroundColor:BGreen];
    [_YesBtn addTarget:self action:@selector(YesBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.contentView addSubview:_YesBtn];
    
    _NoBtn=[[UIButton alloc]initWithFrame:CGRectMake(ScreenWidth-50, 6, 45, 30)];
    [_NoBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [_NoBtn setTitle:@"拒绝" forState:UIControlStateNormal];
    _NoBtn.titleLabel.font=[UIFont systemFontOfSize:15];
    [_NoBtn setBackgroundColor:BRead];
    [_NoBtn addTarget:self action:@selector(NoBtnAction:) forControlEvents:UIControlEventTouchUpInside ];
    [self.contentView addSubview:_NoBtn];
    
    //灰线
    UILabel *lb5=[[UILabel alloc]initWithFrame:CGRectMake(0,39.5 , ScreenWidth, 0.5)];
    lb5.backgroundColor=[UIColor lightGrayColor];
    lb5.text=@"";
    [self.contentView addSubview:lb5];
}
//同意
-(void)YesBtnAction:(UIButton *)send{
    !self.isNOBlock?:self.isNOBlock(@"1");
}
//拒绝
-(void)NoBtnAction:(UIButton *)send{
    
    !self.isNOBlock?:self.isNOBlock(@"2");
    
}


@end
